#ifndef _WAITFORBC_
#define _WAITFORBC_
#include "HardwareInfo.c"
#include <GetSysTime.h>
#include "getcount.c"
#include <SetMotor_Code.h>
#include <SetCentiS.h>
#include <SetTenthS.h>

void waitforbc(int count, int time)
{
    unsigned long starttime = 0;
    long c = 0;
    starttime = GetSysTime();
    while ( GetSysTime()-starttime<time )
    {
        c = getcount();
        if ( c>=count )
        {
            break;
        }
        SetMotor_Code(1, 0, 100);
        SetMotor_Code(2, 0, 100);
        SetCentiS(3);
        SetMotor_Code(1, 2, 100);
        SetMotor_Code(2, 2, 100);
        SetCentiS(4);
        SetMotor_Code(1, 1, 0);
        SetMotor_Code(2, 1, 0);
        SetTenthS(8);
    }
}
#endif

